]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspacesView: Fix scroll direction in RTL locales
authorAbderrahim Kitouni <akitouni@gnome.org>
Sat, 16 Jan 2021 15:29:05 +0000 (16:29 +0100)
committerMarge Bot <marge-bot@gnome.org>
Sat, 30 Jan 2021 11:45:22 +0000 (11:45 +0000)
Scrolling up or down (using the mouse wheel) should scroll to right
or left respectively (rather than the other way around).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1608>

js/ui/workspacesView.js

index ef3e5f68cdbc975f384afdace0b139078700a972..f39d305b7b280d4a43fd18503042814a0082f978 100644 (file)
@@ -787,18 +787,23 @@ class WorkspacesDisplay extends St.Widget {
 
         let workspaceManager = global.workspace_manager;
         const vertical = workspaceManager.layout_rows === -1;
+        const rtl = this.text_direction === Clutter.TextDirection.RTL;
         let activeWs = workspaceManager.get_active_workspace();
         let ws;
         switch (direction) {
         case Clutter.ScrollDirection.UP:
             if (vertical)
                 ws = activeWs.get_neighbor(Meta.MotionDirection.UP);
+            else if (rtl)
+                ws = activeWs.get_neighbor(Meta.MotionDirection.RIGHT);
             else
                 ws = activeWs.get_neighbor(Meta.MotionDirection.LEFT);
             break;
         case Clutter.ScrollDirection.DOWN:
             if (vertical)
                 ws = activeWs.get_neighbor(Meta.MotionDirection.DOWN);
+            else if (rtl)
+                ws = activeWs.get_neighbor(Meta.MotionDirection.LEFT);
             else
                 ws = activeWs.get_neighbor(Meta.MotionDirection.RIGHT);
             break;